---
title: Neo4j Tools
description: Neo4jTools enables agents to interact with Neo4j graph databases for querying and managing graph data.
---

## Code

```python cookbook/tools/neo4j_tools.py
from agno.agent import Agent
from agno.tools.neo4j import Neo4jTools

agent = Agent(
    instructions=[
        "You are a graph database assistant that helps with Neo4j operations",
        "Execute Cypher queries to analyze graph data and relationships",
        "Provide insights about graph structure and patterns",
    ],
    tools=[Neo4jTools()],
    markdown=True,
)

agent.print_response("Show me the schema of the graph database and list all node labels")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set your credentials">
    ```bash
    export NEO4J_URI=bolt://localhost:7687
    export NEO4J_USERNAME=neo4j
    export NEO4J_PASSWORD=your-password
    export OPENAI_API_KEY=xxx
    ```
  </Step>

  <Step title="Install libraries">
    ```bash
    pip install -U neo4j openai agno
    ```
  </Step>

  <Step title="Run Agent">
    <CodeGroup>
    ```bash Mac
    python cookbook/tools/neo4j_tools.py
    ```

    ```bash Windows
    python cookbook/tools/neo4j_tools.py
    ```
    </CodeGroup>
  </Step>
</Steps>
